<!DOCTYPE html>
<html lang="zh" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Log4a 是什么? | Log4a</title>
    <meta name="description" content="优雅、易用的HarmonyOS日志库">
    <meta name="generator" content="VitePress v1.1.4">
    <link rel="preload stylesheet" href="/log4a-docs/assets/style.Bs0ybW4o.css" as="style">
    
    <script type="module" src="/log4a-docs/assets/app.CKVFL8lc.js"></script>
    <link rel="preload" href="/log4a-docs/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/log4a-docs/assets/chunks/framework.DcQ8S4Qz.js">
    <link rel="modulepreload" href="/log4a-docs/assets/chunks/theme.C-i07yX7.js">
    <link rel="modulepreload" href="/log4a-docs/assets/en_guide_what-is-log4a.md.-57KX4bx.lean.js">
    <link rel="icon" type="image/png" sizes="16x16" href="log4a@1x.svg">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar top" data-v-ae24b3ad data-v-ccf7ddec><div class="wrapper" data-v-ccf7ddec><div class="container" data-v-ccf7ddec><div class="title" data-v-ccf7ddec><div class="VPNavBarTitle" data-v-ccf7ddec data-v-ab179fa1><a class="title" href="/log4a-docs/" data-v-ab179fa1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/log4a-docs/log4a@1x.svg" alt data-v-8426fc1a><!--]--><span data-v-ab179fa1>Log4a</span><!--[--><!--]--></a></div></div><div class="content" data-v-ccf7ddec><div class="content-body" data-v-ccf7ddec><!--[--><!--]--><div class="VPNavBarSearch search" data-v-ccf7ddec><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-ccf7ddec data-v-7f418b0f><span id="main-nav-aria-label" class="visually-hidden" data-v-7f418b0f>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/log4a-docs/guide/getting-started" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>指南</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/log4a-docs/reference/log-manager" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>参考</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-7f418b0f data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>1.4.0</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-e7ea1737><div class="items" data-v-e7ea1737><!--[--><!--[--><div class="VPMenuLink" data-v-e7ea1737 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://gitee.com/ericple/log4a/blob/master/library/CHANGELOG.md" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->更新日志<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-ccf7ddec data-v-e6aabb21><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-e6aabb21 data-v-d1f28634 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-d1f28634></span><span class="vpi-moon moon" data-v-d1f28634></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-ccf7ddec data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/ericple/log4a" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-ccf7ddec data-v-d0bd9dde data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-b6c34ac9><span class="vpi-more-horizontal icon" data-v-b6c34ac9></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-e7ea1737><!----><!--[--><!--[--><!----><div class="group" data-v-d0bd9dde><div class="item appearance" data-v-d0bd9dde><p class="label" data-v-d0bd9dde>Appearance</p><div class="appearance-action" data-v-d0bd9dde><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-d0bd9dde data-v-d1f28634 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-d1f28634></span><span class="vpi-moon moon" data-v-d1f28634></span><!--]--></span></span></button></div></div></div><div class="group" data-v-d0bd9dde><div class="item social-links" data-v-d0bd9dde><div class="VPSocialLinks social-links-list" data-v-d0bd9dde data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/ericple/log4a" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-ccf7ddec data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-ccf7ddec><div class="divider-line" data-v-ccf7ddec></div></div></div><!----></header><div class="VPLocalNav empty fixed" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><!----><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-17a5e62e><button data-v-17a5e62e>Return to top</button><!----></div></div></div><!----><div class="VPContent" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" role="navigation" data-v-3f215769 data-v-269c27a6><div class="content" data-v-269c27a6><div class="outline-marker" data-v-269c27a6></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-269c27a6>On this page</div><ul class="VPDocOutlineItem root" data-v-269c27a6 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _log4a-docs_en_guide_what-is-log4a" data-v-39a288b8><div><h1 id="log4a-是什么" tabindex="-1">Log4a 是什么? <a class="header-anchor" href="#log4a-是什么" aria-label="Permalink to &quot;Log4a 是什么?&quot;">​</a></h1><p>Log4a是一个ArkTS/TypeScript使用的日志库，为高性能、简单易用为宗旨而设计。</p><p>只是想尝试一下？跳到<a href="/log4a-docs/guide/getting-started">快速开始</a></p><p><a href="https://gitee.com/ericple/log4a" target="_blank" rel="noreferrer"><img src="https://gitee.com/ericple/log4a/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b" alt="Ericple/log4a"></a></p><h2 id="使用场景" tabindex="-1">使用场景 <a class="header-anchor" href="#使用场景" aria-label="Permalink to &quot;使用场景&quot;">​</a></h2><ul><li><h3 id="开发时debug" tabindex="-1">开发时debug <a class="header-anchor" href="#开发时debug" aria-label="Permalink to &quot;开发时debug&quot;">​</a></h3></li></ul><p>开发者可以在开发阶段集成Log4a，通过生成日志、追踪函数运行，帮助获取应用运行信息，并快速定位问题。</p><ul><li><h3 id="应用上线后进行日志收集" tabindex="-1">应用上线后进行日志收集 <a class="header-anchor" href="#应用上线后进行日志收集" aria-label="Permalink to &quot;应用上线后进行日志收集&quot;">​</a></h3></li></ul><p>借助Log4a设计精妙的日志输出能力，开发者可以将日志输出到一个或多个文件，并通过一定手段将日志上传到服务器用于分析应用运行情况。</p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-d4a0bba5><!--[--><!--]--><!----><!----></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>以 Apache License 2.0 许可证发布</p><p class="copyright" data-v-e315a0ad>Copyright ©️ 2024-至今 郭挺劲</p></div></footer><!--[--><!--]--></div></div>
    <script>window.__VP_HASH_MAP__=JSON.parse("{\"en_index.md\":\"BF7jtfOe\",\"guide_format.md\":\"C79OSdvL\",\"reference_log-manager.md\":\"BeIm4LSX\",\"guide_intercept-console.md\":\"FcFJxN1c\",\"reference_daily-rolling-file-appender.md\":\"1zqeKUct\",\"reference_abstract-appender.md\":\"Cem4bulA\",\"zh-tw_reference_tags.md\":\"DqxMdvls\",\"reference_file-appender.md\":\"BIVgBS12\",\"en_reference_log-manager.md\":\"CbgPELgf\",\"guide_custom-layout.md\":\"C0TuAlRA\",\"guide_what-is-log4a.md\":\"CK61PeoU\",\"reference_decorators.md\":\"CqFbgAHb\",\"guide_parameter-priority.md\":\"I1gaByrU\",\"reference_tags.md\":\"5FtazP79\",\"guide_getting-started.md\":\"CbXTYjw6\",\"reference_tcp-socket-appender.md\":\"D_tlKq61\",\"reference_udp-socket-appender.md\":\"dF2yC5YV\",\"guide_appender.md\":\"lJX8Kh1o\",\"zh-tw_guide_what-is-log4a.md\":\"CsLr107O\",\"en_reference_tags.md\":\"BarVvWZS\",\"zh-tw_reference_decorators.md\":\"tvSSaDDU\",\"guide_custom-appender.md\":\"DImclcsg\",\"zh-tw_guide_getting-started.md\":\"CEE4AIWU\",\"zh-tw_guide_appender.md\":\"C8H2zUM7\",\"zh-tw_index.md\":\"B6t1k6p3\",\"index.md\":\"U3nfVLpR\",\"en_guide_what-is-log4a.md\":\"-57KX4bx\",\"guide_rolling-file-appender.md\":\"DPAbW_Js\",\"en_reference_logger.md\":\"BUHfLhiT\",\"en_reference_marker-manager.md\":\"Cospl-DS\",\"reference_logger.md\":\"yqhQwVzU\",\"guide_log-to-socket.md\":\"KSzJqgFG\",\"reference_marker-manager.md\":\"T-lmE7KI\",\"zh-tw_reference_marker-manager.md\":\"DmivIgcY\",\"zh-tw_reference_logger.md\":\"CpImrc99\",\"en_reference_decorators.md\":\"DYFu_3lp\",\"zh-tw_reference_log-manager.md\":\"D9IIjYl7\",\"guide_log-with-worker.md\":\"CGFZ9AYZ\",\"en_guide_appender.md\":\"CcF2MM9v\",\"en_guide_getting-started.md\":\"DjONPgfJ\",\"guide_best-practice.md\":\"4fkbkJ2Q\",\"reference_level.md\":\"Dd9l-xdt\",\"reference_rolling-file-appender.md\":\"Bht_8rK4\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Log4a\",\"description\":\"优雅、易用的HarmonyOS日志库\",\"base\":\"/log4a-docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"指南\",\"link\":\"/guide/getting-started\"},{\"text\":\"参考\",\"link\":\"/reference/log-manager\"},{\"text\":\"1.4.0\",\"items\":[{\"text\":\"更新日志\",\"link\":\"https://gitee.com/ericple/log4a/blob/master/library/CHANGELOG.md\"}]}],\"sidebar\":{\"/guide/\":[{\"text\":\"简介\",\"items\":[{\"text\":\"什么是Log4a?\",\"link\":\"/guide/what-is-log4a\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"追加器\",\"link\":\"/guide/appender\"}],\"collapsed\":false},{\"text\":\"输出日志\",\"items\":[{\"text\":\"参数作用优先级\",\"link\":\"/guide/parameter-priority\"},{\"text\":\"使用多线程输出\",\"link\":\"/guide/log-with-worker\"},{\"text\":\"日志消息构建\",\"link\":\"/guide/format\"}]},{\"text\":\"进阶使用\",\"items\":[{\"text\":\"自定义追加器\",\"link\":\"/guide/custom-appender\"},{\"text\":\"输出到服务器\",\"link\":\"/guide/log-to-socket\"},{\"text\":\"自定义布局\",\"link\":\"/guide/custom-layout\"},{\"text\":\"console拦截\",\"link\":\"/guide/intercept-console\"},{\"text\":\"最佳实践\",\"link\":\"/guide/best-practice\"}]},{\"text\":\"API参考\",\"link\":\"/reference/log-manager\"}],\"/reference/\":[{\"text\":\"API参考\",\"items\":[{\"text\":\"LogManager\",\"link\":\"/reference/log-manager\"},{\"text\":\"Logger\",\"link\":\"/reference/logger\"},{\"text\":\"MarkerManager\",\"link\":\"/reference/marker-manager\"},{\"text\":\"Level\",\"link\":\"/reference/level\"},{\"text\":\"追加器\",\"items\":[{\"text\":\"AbstractAppender\",\"link\":\"/reference/abstract-appender\"},{\"text\":\"FileAppender\",\"link\":\"/reference/file-appender\"},{\"text\":\"RollingFileAppender\",\"link\":\"/reference/rolling-file-appender\"},{\"text\":\"DailyRollingFileAppender\",\"link\":\"/reference/daily-rolling-file-appender\"},{\"text\":\"TCPSocketAppender\",\"link\":\"/reference/tcp-socket-appender\"},{\"text\":\"UDPSocketAppender\",\"link\":\"/reference/udp-socket-appender\"}]}],\"collapsed\":false},{\"text\":\"装饰器和标签\",\"items\":[{\"text\":\"装饰器\",\"link\":\"/reference/decorators\"},{\"text\":\"标签\",\"link\":\"/reference/tags\",\"collapsed\":false}],\"collapsed\":false}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/ericple/log4a\"}],\"footer\":{\"message\":\"以 Apache License 2.0 许可证发布\",\"copyright\":\"Copyright ©️ 2024-至今 郭挺劲\"},\"search\":{\"provider\":\"local\"},\"logo\":{\"src\":\"/log4a@1x.svg\"}},\"locales\":{\"root\":{\"label\":\"简体中文\",\"lang\":\"zh\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
    
  </body>
</html>